/****************************************************************************

	COPYRIGHT(C) MAXSI SOFTWARE, JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010

    This file is part of Maxsi Distribution.

    Maxsi Distribution is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Maxsi Distribution is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Maxsi Distribution. If not, see <http://www.gnu.org/licenses/>.

	*/ #include "MaxsiDistributionContributors.h" /*

	If you modify this file, please enter your name below and provide contact
	information in MaxsiDistributionContributors.h. For more information please see
	MaxsiDistributionContributors.h.
	
	Contributors to this file:

	- Jonas 'Sortie' Termansen
	- [your name here]

	MaxsiDistribution.dll
	Distributing since 2008

	MaxsiDistributionModule001.h
	An interface to all Maxsi Distribution sub-modules

****************************************************************************/

#ifndef MaxsiDistributionModule001_H
#define MaxsiDistributionModule001_H

//=============================================================================
// Undef all redirections to previous versions of this interface and make sure
// all the interfaces we refer to are properly versioned here. It doesn't
// matter if these interfaces are not the newest versions, just as long as
// as these def's refer to the used versions.
//=============================================================================
// Maxsi Distribution Module
#ifdef MaxsiDistributionModule
#undef MaxsiDistributionModule
#endif
#define MaxsiDistributionModule MaxsiDistributionModule001

// Maxsi Distribution Interface
#ifdef MaxsiDistributionInterface
#undef MaxsiDistributionInterface
#endif
#define MaxsiDistributionInterface MaxsiDistributionInterface001

//=============================================================================
// Maxsi Distribution Module
//=============================================================================
class	MaxsiDistributionModule
{
public:
	MaxsiDistributionModule();
	~MaxsiDistributionModule();

	//=============================================================================
	//	char*	GetModuleName()
	//
	//	Returns a static string with the name of this particular MD Module.
	//=============================================================================

	virtual	MESTR*	GetModuleName() = 0;
	
	//=============================================================================
	//	bool	SetMaxsiDistributionInterface(MaxsiDistributionInterface* Interface)
	//
	//	Returns a static string with the name of this particular MD Module.
	//=============================================================================

	virtual	bool	SetMaxsiDistributionInterface(MaxsiDistributionInterface* Interface) = 0;

	//=============================================================================
	//	bool	CreateSession();
	//
	//	Terminates all data belonging to previous sessions and creates a new default
	//	session. A ses
	//=============================================================================

	virtual bool	CreateSession() = 0;

	//=============================================================================
	//	bool	SaveSession(char** OutBuffer, size_t* OutBufferLength);
	//
	//	Exports a buffer with all the session-data this module needs to store
	//	permanently for this session specificly. The application should take care
	//	of storing this and passing it onto RestoreSession() when the session is
	//	restored. OutBuffer points to a	char* which will be changed to point to a
	//	buffer containing OutBufferLength bytes that should be saved. Call
	//	SavedSession() when done with the buffer.
	//=============================================================================

	virtual bool	SaveSession(char** OutBuffer, size_t* OutBufferLength) = 0;

	//=============================================================================
	//	bool	SavedSession(char* OutBuffer, size_t OutBufferLength);
	//
	//	Deletes the buffer allocated for use by the application when SaveSession()
	//	is called. You must call SavedSession() when done with the buffer.
	//=============================================================================
	
	virtual bool	SavedSession(char* OutBuffer, size_t OutBufferLength) = 0;

	//=============================================================================
	//	bool	RestoreSession(char* OutBuffer, size_t OutBufferLength);
	//
	//	Restores a previous session.
	//=============================================================================

	virtual bool	RestoreSession(char* Buffer, size_t BufferLength) = 0;

};

#endif